/// <reference path="fKanban.js" />
/// <reference path="fKanban.user.js" />
fKanban.sprint = function () { }
fKanban.sprint.prototype = new fKanban();
fKanban.sprint.prototype.constructor = fKanban.sprint;
fKanban.sprint.prototype.supr = fKanban.prototype;

//add
fKanban.sprint.prototype.add = function (item, callback) {
    $.ajax({
        type: "POST",
        url: website + "Online/AddSprint",
        dataType: "json",
        data: item,
        success: function (obj) {
            Info(obj.Message);
            if (callback) callback();
        },
        error: function (err) {
            Info(err);
        }
    });
};

//update
fKanban.sprint.prototype.update = function (item, callback) {
    $.ajax({
        type: "POST",
        url: website + "Online/UpdateSprint",
        dataType: "json",
        data: item,
        success: function (obj) {
            Info(obj.Message);
            if (callback) callback();
        },
        error: function (err) {
            Info(err);
        }
    });
};

//remove
fKanban.sprint.prototype.remove = function (id, callback) {
    $.ajax({
        type: "POST",
        url: website + "Online/RemoveSprint",
        dataType: "json",
        data: { id: id },
        success: function (obj) {
            Info(obj.Message);
            if (callback) callback(obj.rowsAffected);
        },
        error: function (err) {
            Info(err);
        }
    });
};

//loadDataById
fKanban.sprint.prototype.loadDataById = function (id, callback, onerror) {
    $.ajax({
        type: "POST",
        url: website + "Online/LoadSprintById",
        dataType: "json",
        data: { id: id },
        success: function (obj) {
            if (callback) callback(obj.Result);
        },
        error: function (err) {
            Info(err);
        }
    });
};